{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 31,
   "outputs": [],
   "source": [
    "import pandas as pd\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "outputs": [],
   "source": [
    "list_2d = [[1, 2],\n",
    "           [3, 4]]"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "outputs": [
    {
     "data": {
      "text/plain": "   0  1\n0  1  2\n1  3  4",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n      <th>1</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>3</td>\n      <td>4</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 33
    }
   ],
   "source": [
    "df = pd.DataFrame(list_2d)\n",
    "df"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "outputs": [
    {
     "data": {
      "text/plain": "   A  B\nx  1  2\ny  3  4",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>A</th>\n      <th>B</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>x</th>\n      <td>1</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>y</th>\n      <td>3</td>\n      <td>4</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 34
    }
   ],
   "source": [
    "df = pd.DataFrame(list_2d,\n",
    "                  columns=['A', 'B'],\n",
    "                  index=['x', 'y'])\n",
    "df"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "outputs": [
    {
     "data": {
      "text/plain": "   A  B\nx  1  2\ny  3  4",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>A</th>\n      <th>B</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>x</th>\n      <td>1</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>y</th>\n      <td>3</td>\n      <td>4</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 35
    }
   ],
   "source": [
    "d = {'A': [1, 3], 'B': [2, 4]}\n",
    "df = pd.DataFrame(d, index=['x', 'y'])\n",
    "df"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "outputs": [
    {
     "data": {
      "text/plain": "col_name    商品代码  颜色代码  商品名称 品牌   成本  季节  商品年份\nindex_name                                    \nQTVW5600    QTVW  5600   羽绒服  A  180  冬季  2018\nAXTB3200    AXTB  3200    棉服  B   90  冬季  2019\nVBOY1800    VBOY  1800   家居服  C  120  冬季  2018\nHWLA4700    HWLA  4700  长袖T恤  A   30  秋季  2020\nXDQV5600    XDQV  5600    卫衣  B   56  春季  2019\nXHQA3700    XHQA  3700  羊毛大衣  C  200  冬季  2018\nUQNA9200    UQNA  9200    毛衣  B   68  春季  2020\nFLHR1800    FLHR  1800  短袖T恤  A   25  夏季  2019\nLCHM9800    LCHM  9800  保暖内衣  B   50  冬季  2018\nAGDH5500    AGDH  5500   牛仔裤  C   80  四季  2019\nYZFM1200    YZFM  1200    夹克  B   70  秋季  2019\nPWDK9200    PWDK  9200  运动长裤  B   60  四季  2020",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th>col_name</th>\n      <th>商品代码</th>\n      <th>颜色代码</th>\n      <th>商品名称</th>\n      <th>品牌</th>\n      <th>成本</th>\n      <th>季节</th>\n      <th>商品年份</th>\n    </tr>\n    <tr>\n      <th>index_name</th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>QTVW5600</th>\n      <td>QTVW</td>\n      <td>5600</td>\n      <td>羽绒服</td>\n      <td>A</td>\n      <td>180</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>AXTB3200</th>\n      <td>AXTB</td>\n      <td>3200</td>\n      <td>棉服</td>\n      <td>B</td>\n      <td>90</td>\n      <td>冬季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>VBOY1800</th>\n      <td>VBOY</td>\n      <td>1800</td>\n      <td>家居服</td>\n      <td>C</td>\n      <td>120</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>HWLA4700</th>\n      <td>HWLA</td>\n      <td>4700</td>\n      <td>长袖T恤</td>\n      <td>A</td>\n      <td>30</td>\n      <td>秋季</td>\n      <td>2020</td>\n    </tr>\n    <tr>\n      <th>XDQV5600</th>\n      <td>XDQV</td>\n      <td>5600</td>\n      <td>卫衣</td>\n      <td>B</td>\n      <td>56</td>\n      <td>春季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>XHQA3700</th>\n      <td>XHQA</td>\n      <td>3700</td>\n      <td>羊毛大衣</td>\n      <td>C</td>\n      <td>200</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>UQNA9200</th>\n      <td>UQNA</td>\n      <td>9200</td>\n      <td>毛衣</td>\n      <td>B</td>\n      <td>68</td>\n      <td>春季</td>\n      <td>2020</td>\n    </tr>\n    <tr>\n      <th>FLHR1800</th>\n      <td>FLHR</td>\n      <td>1800</td>\n      <td>短袖T恤</td>\n      <td>A</td>\n      <td>25</td>\n      <td>夏季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>LCHM9800</th>\n      <td>LCHM</td>\n      <td>9800</td>\n      <td>保暖内衣</td>\n      <td>B</td>\n      <td>50</td>\n      <td>冬季</td>\n      <td>2018</td>\n    </tr>\n    <tr>\n      <th>AGDH5500</th>\n      <td>AGDH</td>\n      <td>5500</td>\n      <td>牛仔裤</td>\n      <td>C</td>\n      <td>80</td>\n      <td>四季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>YZFM1200</th>\n      <td>YZFM</td>\n      <td>1200</td>\n      <td>夹克</td>\n      <td>B</td>\n      <td>70</td>\n      <td>秋季</td>\n      <td>2019</td>\n    </tr>\n    <tr>\n      <th>PWDK9200</th>\n      <td>PWDK</td>\n      <td>9200</td>\n      <td>运动长裤</td>\n      <td>B</td>\n      <td>60</td>\n      <td>四季</td>\n      <td>2020</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 36
    }
   ],
   "source": [
    "df = pd.read_excel('goods_base.xlsx',index_col=0)\n",
    "df.columns.name = 'col_name'\n",
    "df.index.name = 'index_name'\n",
    "df\n",
    "\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  },
  "pycharm": {
   "stem_cell": {
    "cell_type": "raw",
    "source": [],
    "metadata": {
     "collapsed": false
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}